function desc = desc_mat(d,lam1,lam2,lam3,desc_pattern)
% get the corresponding matrix for evaluating algorithms
% from degree d to d-1
m_rows = d*(d+1)/2;
m_cols = (d+1)*(d+2)/2;
I = (1:m_rows)';
Id = ones(m_rows,1);
desc = sparse(I,desc_pattern(I,1),lam1*Id,m_rows,m_cols) + ...
        sparse(I,desc_pattern(I,2),lam2*Id,m_rows,m_cols) + ...
        sparse(I,desc_pattern(I,3),lam3*Id,m_rows,m_cols);